<?php
/**
 * ============================================================================
 * Copyright (c) 2015-2018 贵州大师兄信息技术有限公司 All rights reserved.
 * siteַ: http://www.dsxcms.com
 * ============================================================================
 * @author:     David Song<songdewei@163.com>
 * @version:    v1.0.0
 * ---------------------------------------------
 * Date: 2018/10/31
 * Time: 1:47 PM
 */

namespace App\Library;


class KdResponse
{
    private $response = [
        'LogisticCode'=>'',
        'ShipperCode'=>'',
        'Traces'=>'',
        'State'=>'',
        'OrderCode'=>'',
        'EBusinessID'=>'',
        'Reason'=>'',
        'Success'=>''
    ];

    public function __construct($response)
    {
        if (is_object($response))
        {
            $this->response = get_object_vars($response);
        } else {
            $this->response = $response;
        }
    }

    public function getLogisticCode()
    {
        return $this->response['LogisticCode'];
    }

    public function getShipperCode()
    {
        return $this->response['ShipperCode'];
    }

    public function getTraces()
    {
        return $this->response['Traces'];
    }

    public function getState()
    {
        return $this->response['State'];
    }

    public function getOrderCode()
    {
        return $this->response['OrderCode'];
    }

    public function getEBusinessID()
    {
        return $this->response['EBusinessID'];
    }

    public function getReason()
    {
        return $this->response['Reason'];
    }

    public function getSuccess()
    {
        return $this->response['Success'];
    }

    public function response()
    {
        return $this->response;
    }
}
